<template>
  <div>
    <header class="header">
      <div @click="goBack">
        <van-icon name="arrow-left" size="24"></van-icon>
      </div>
      <van-search v-model="searchInput" placeholder="请输入搜索关键词" />
      <span>搜索</span>
    </header>
  </div>
</template>

<script>
export default {
  name: 'search-list',
  data() {
    return {
      searchInput: ''
    }
  },
  methods: {
    goBack() {
      this.$router.push('/search')
    }
  },
  created() {
    this.searchInput = JSON.parse(localStorage.getItem('searchValue'))[0]
  },
}
</script>

<style lang='less' scoped>
.header {
  display: flex;
  align-items: center;
  background-color: #b0352f;

  .van-icon {
    color: #fff;
    margin-left: 5px;
  }

  span {
    color: #fff;
    margin-right: 10px;
  }

  .van-search {
    flex: 1;
    background-color: #b0352f;
  }

  .van-search__content {
    border-radius: 15px;
  }
}
</style>